{{ template "header" . }}
{{ template "admin"  . }}

<main>
    <form>
        <label for=golfer>Golfer</label>
        <datalist id=golfers></datalist>
        <input autocomplete=off id=golfer list=golfers name=golfer
            value='{{ .Request.FormValue "golfer" }}'>

        <label for=hole>Hole</label>
        <select id=hole name=hole>
            <option value>All
        {{ range .Data.Holes }}
            <option value={{ .ID }}
                {{ if eq .ID ($.Request.FormValue "hole") }}selected{{ end }}>
                {{ .Name }}
                {{ if .Experiment }}(exp.){{ end }}
        {{ end }}
        </select>

        <label for=lang>Lang</label>
        <select id=lang name=lang>
            <option value>All
        {{ range .Data.Langs }}
            <option value={{ .ID }}
                {{ if eq .ID ($.Request.FormValue "lang") }}selected{{ end }}>
                {{ .Name }}
                {{ if .Experiment }}(exp.){{ end }}
        {{ end }}
        </select>

        <label for=workers>Workers</label>
        <input id=workers min=1 name=workers type=number
            value='{{ with .Request.FormValue "workers" }}{{ . }}{{ else }}3{{ end }}'>

        <label for=failing>Failing</label>
        <input {{ if eq "on" (.Request.FormValue "failing") }}checked{{ end }}
            id=failing name=failing type=checkbox>

        <label for=no-new-failures>No New Failures</label>
        <input {{ if eq "on" (.Request.FormValue "no-new-failures") }}checked{{ end }}
            id=no-new-failures name=no-new-failures type=checkbox>

        <label for=old-lang-digests>Old Lang Digests</label>
        <input {{ if eq "on" (.Request.FormValue "old-lang-digests") }}checked{{ end }}
            id=old-lang-digests name=old-lang-digests type=checkbox>

        <label for=tested-from>Last Tested</label>
        <span>
            <input id=tested-from name=tested-from type=date
            {{ with .Request.FormValue "tested-from" }}
                value="{{ . }}"
            {{ else }}
                value='{{ .Data.TestedFrom.Format "2006-01-02" }}'
            {{ end }}>
            –
            <input id=tested-to name=tested-to type=date
            {{ with .Request.FormValue "tested-to" }}
                value="{{ . }}"
            {{ else }}
                value='{{ .Data.TestedTo.Format "2006-01-02" }}'
            {{ end }}>
        </span>

        <div>
            <div id=status></div>
            <button class="btn blue" id=run>Run</button>
            <button class="btn yellow" id=stop type=button>Stop</button>
        </div>
    </form>
    <table>
        <thead>
            <tr>
                <th>Last Tested
                <th>Hole
                <th>Lang
                <th>Golfer
                <th>Took
                <th>Pass
                <th>Stderr
        <tbody>
    </table>
</main>

{{ template "footer" }}
